package com.qf.ssm.service.Impl;

import com.qf.ssm.entity.FrontCategoryFirst;
import com.qf.ssm.ex.ServiceException;
import com.qf.ssm.mapper.FrontCategoryFirstMapper;
import com.qf.ssm.service.FrontCategoryFirstService;
import com.qf.ssm.utils.ResponseCode;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

@Service
public class FrontCategoryFirstServiceImpl implements FrontCategoryFirstService {

    @Resource
    private FrontCategoryFirstMapper frontCategoryFirstMapper;

    /**
     * 通过主键删除
     *
     * @param fcfId
     * @return
     */
    @Override
    public int deleteByPrimaryKey(Integer fcfId) {
            return frontCategoryFirstMapper.deleteByPrimaryKey(fcfId);


    }

    /**
     * 插入一条数据
     *
     * @param record
     * @return
     */
    @Override
    public int insert(FrontCategoryFirst record) {

            return frontCategoryFirstMapper.insert(record);


    }


    @Override
    public int insertSelective(FrontCategoryFirst record) {
        return frontCategoryFirstMapper.insertSelective(record);
    }

    @Override
    public FrontCategoryFirst selectByPrimaryKey(Integer fcfId) {
        return frontCategoryFirstMapper.selectByPrimaryKey(fcfId);
    }

    @Override
    public int updateByPrimaryKeySelective(FrontCategoryFirst record) {
        return frontCategoryFirstMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(FrontCategoryFirst record) {
        return frontCategoryFirstMapper.updateByPrimaryKey(record);
    }

    @Override
    public FrontCategoryFirst selectFirstAndTwo(int fcfId) {
        return frontCategoryFirstMapper.selectFirstAndTwo(fcfId);
    }

 /*   @Override
    public int updateBatch(List<FrontCategoryFirst> list) {
        return frontCategoryFirstMapper.updateBatch(list);
    }*/

    @Override
    public int batchInsert(List<FrontCategoryFirst> list) {

            return frontCategoryFirstMapper.batchInsert(list);

    }



    @Override
    public int batchDeleteCategory(int[] fcfIds) {
        return frontCategoryFirstMapper.batchDeleteCategory(fcfIds);
    }

    @Override
    public FrontCategoryFirst selectFirstAndCommodity(String fcfName) {
        return frontCategoryFirstMapper.selectFirstAndCommodity(fcfName);
    }
}
